#include <repository/employee/schedule_repository.h>

using namespace model;

// CRUD Operations
insert_ret_type ScheduleRepository::create(const ScheduleDTO& schedule_dto)
{
  return _insert(schedule_dto);
};


update_ret_type ScheduleRepository::updateById(const in_id_type id,
                                               const ScheduleDTO& dto)
{
  return _update(dto, db::schedule{}.id == id);
};

delete_ret_type ScheduleRepository::removeById(const in_id_type id)
{
  return _remove(db::schedule{}.id == id);
}

// Custom Queries
select_ret_type<ScheduleDTO> ScheduleRepository::getAll()
{
  return _select(db::schedule{}.id >= 0);
}

select_ret_type<ScheduleDTO> ScheduleRepository::getByPage(int page_size,
                                                           int offset)
{
  return _select_from(db::schedule{}.id >= 0, page_size, offset);
}

count_type ScheduleRepository::count()
{
  return _countById();
}

// 其他方法实现...
